package com.itheima.Thraed.ThreadPrinciple;

public class demo03 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread("t1") {
            @Override
            public void run() {
                System.out.println("enter sleep。。。");
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    System.out.println("wake up");
                }
            }
        };
        t1.start();
        // 让主线程睡眠一秒 使线程t1进入睡眠状态
        Thread.sleep(1000);
        System.out.println("interrut");
        t1.interrupt();
    }
}
